/*
 * @description:
 * @version: 1.0.1
 * @Author: xuqiulin
 * @Date: 2021-04-30 21:33:32
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-04-30 21:42:17
 */
package testconf

import (
	"GameServer/Common/data"
	"GameServer/Common/utils"
	"GameServer/Game/dbmodule"
	"GameServer/conf"
	"log"
	"math/rand"
)

func InitTestConf() {
	err := conf.Conf.Load("/home/luxingwen/work/server/trunk/cmt1-server/appconf/app.config")
	if err != nil {
		log.Fatal("config load err:", err)
	}

	dbmodule.MgoDB.GameDB.Init()
	dbmodule.MgoDB.GameLogDB.Init()

	err = data.Init("/home/luxingwen/work/server/trunk/cmt1-server/data/json")
	if err != nil {
		log.Fatal(err)
	}
	rand.Seed(utils.TNow().UnixNano())
}

func InitTestConf2() {
	err := conf.Conf.Load("E:/workspacemy/branches/src/cmt1-server/appconf/app.config")
	if err != nil {
		log.Fatal("config load err:", err)
	}

	dbmodule.MgoDB.GameDB.Init()
	dbmodule.MgoDB.GameLogDB.Init()

	err = data.Init("E:/workspacemy/branches/src/cmt1-server/data/json")
	if err != nil {
		log.Fatal(err)
	}
	utils.SetJsonConfDir("E:/workspacemy/branches/src/cmt1-server/data/json")
	utils.SetLocation("UTC")
	rand.Seed(utils.TNow().UnixNano())
}
